package old.apiday03;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArrayToListDemo {
    public static void main(String[] args) {
        String[] array={"one","two","three","four","five"};
        System.out.println("array:"+ Arrays.toString(array));
        List<String> list=Arrays.asList(array);//asList数组是定长的，不能自动扩容或者删改
        System.out.println("list"+list);
        array[1]="six";
        System.out.println("array"+Arrays.toString(array));
        System.out.println("list"+list);
        List<String>list1=new ArrayList<>(list);
        list1.add("!!!!!");
        System.out.println("list1"+list1);

    }
}
